#!/bin/bash

# GeoGebra 服务快速部署脚本

echo "=========================================="
echo "GeoGebra 服务快速部署"
echo "=========================================="

# 检查deploy文件夹是否存在
if [ ! -d "deploy" ]; then
    echo "错误: 未找到deploy文件夹"
    exit 1
fi

# 检查参数
case "$1" in
    "start")
        echo "启动所有服务..."
        ./deploy/start_all_services.sh
        ;;
    "stop")
        echo "停止所有服务..."
        ./deploy/stop_all_services.sh
        ;;
    "status")
        echo "检查服务状态..."
        ./deploy/check_services.sh
        ;;
    "help"|"")
        echo "用法: $0 {start|stop|status|help}"
        echo ""
        echo "命令说明:"
        echo "  start   - 启动所有服务"
        echo "  stop    - 停止所有服务"
        echo "  status  - 检查服务状态"
        echo "  help    - 显示此帮助信息"
        echo ""
        echo "详细文档请查看: deploy/README_DEPLOYMENT.md"
        ;;
    *)
        echo "错误: 未知命令 '$1'"
        echo "使用 '$0 help' 查看帮助"
        exit 1
        ;;
esac 